 begintownscript;
variables;
short choice,i;

body;
beginstate init_state;
i = 0;
while(char_ok(i) == 0){
	i = i + 1;
}
activate_hidden_group(1);
activate_hidden_group(2);
activate_hidden_group(3);
set_terrain(25,26,0);
relocate_character(i,46,1);
set_character_pose(i,14);
force_view_center(46,1);
force_instant_terrain_redraw();

message_dialog("A damp rag was pressed against my face and I lost consciousness.","");
break;

beginstate exit_state;
break;

beginstate start_state;
if((get_flag(18,0) == 0) && (get_flag(18,3) == 1)){
	message_dialog("_Sir!_ An underling stepped through the door behind me and promptly made his report. _Sir, the courier is here._","");
	message_dialog("_Courier? What the hell are you talking about? Why are you troubling me with these details?_","");
	message_dialog("_Sir, perhaps I wasn't clear enough. THE courier is here-- the one who was delivering that teleportation device for Mauricio._","");
	message_dialog("_The...... courier....._","_Yes, bring him to me. I would very much like to-- speak-- with him._");
	play_sound(58);
	activate_hidden_group(4);
	force_instant_terrain_redraw();
	message_dialog("The courier, as they called him, entered the room hesitantly. He was a lean but well muscled man who appeared to know how to handle himself. It was clear though that being thrust into this eerie room had rattled even him.","_So the courier finally arrives. Take a seat._ Samael intoned.");
	message_dialog("The man crossed to the chair next to me and sat down, eyeing the shadows at the edges of the room as he did so.","Samael launched right into his tirade of berating and belittling. The courier was taking the curses and threats of hideous torture fairly well-- something gave me the feeling he wasn't your average mailman.");
	message_dialog("I wasn't sparing the conversation much attention, though. I was trying to work out a way to get out of here before I was flayed alive.","I could burn my bonds with a simple fire spell-- although casting a spell at this point was risking setting myself on fire-- but where did that leave me? Who knows how many men were waiting in the shadows, ready to cut me down.");
	message_dialog("_You have cost us dearly-- and it will cost you dearly. I promise you that._","It sounded like the courier was in the same boat. From what I'd heard he had as much a hand in the failed rescue attempt as I. If he'd had that package delivered on time they could have teleported out of there with Durant no problem.");
	message_dialog("Teleported right out of there.... Teleport right out of..... here.....","");
	message_dialog("My eyes strayed to the package in the courier's lap. But my thoughts were interrupted when another underling barged in to report to Samael.","");
	message_dialog("_Sir._","");
	message_dialog("_I have half a mind to--_","");
	message_dialog("_Sir-- SIR!_","");
	message_dialog("_WHAT THE HELL IS IT NOW?_","");
	message_dialog("_Sir, I have urgent news._","");
	message_dialog("_It will have to wait. I am dealing with this... this... DISGRACE... right now._","");
	message_dialog("_I'm sorry sir, but it can not wait. It is very urgent._","");
	message_dialog("Samael stood to leave, and the others filed out behind him, leaving only the two guards at the door to watch the courier and I.","I hardly took notice, though, I was too enraptured by the package in the man's lap. Our ticket out.....");
	message_dialog("The sound of the door slamming shut behind them brought me back to reality.","");
	erase_char(1001);
	activate_hidden_group(2);
	set_flag(18,0,1);
	set_name(7,"Courier");
	set_char_dialogue_pic(7,304,0);
}
if((get_flag(18,0) == 2) && (get_flag(18,1) == 0)){
	set_flag(18,1,1);
	set_character_facing(7,2);
	set_character_pose(7,1);
	force_instant_terrain_redraw();
	play_sound(157);
	pause(2);

	set_character_pose(7,2);
	force_instant_terrain_redraw();

	play_sound(-29);
	set_character_pose(14,11);
	force_instant_terrain_redraw();
	pause(1);

	set_character_pose(14,12);
	force_instant_terrain_redraw();
	pause(1);

	set_character_pose(14,13);
	force_instant_terrain_redraw();
	pause(1);

	set_character_pose(14,14);
	force_instant_terrain_redraw();
	pause(1);
	erase_char(14);

	message_dialog("Instead of delivering a crushing blow, though, the guard simply jerked his head to the side and collapsed.","The courier stood behind him, his hands in a fighter's stance. He had no weapons, but that wouldn't be a hindrance judging by his earlier display. He reached for a knife to sever my bonds, but I beat him to it.");
	play_sound(74);
	message_dialog("I concentrated-- and my bonds burst into flame just as I'd intended! Perhaps I was getting my old touch back or maybe it was just lucky-- I hoped it was the former.","I stood and shook off the burned remains of my bonds. Suddenly the door to the north burst open again and Samael strode into the room, issuing orders to the subordinates that trailed him.");
	message_dialog("_.... tell them to hold off the Watch long enough for us to escape with the teleportal, and then to make their own exit through the escape tunnels. Execute these fools, we cannot take them wi--_","Suddenly he noticed that I was no longer bound, and that a corpse lay at the feet of the courier, who from the look of it was ready to make some more.");
	reset_dialog();
	add_dialog_str(0,"I wasn't sure what was worse news-- that Samael had given the order to execute us, or that the city watch was on its way. Samael seemed to be more immediately pressing.",0);
	add_dialog_str(1," Meanwhile all attention had shifted to the package in the courier's hands. _I do not have time for this nonsense._ Samael said softly. _I do not know what you think to gain by striking at my men, but you are clearly outmatched and outnumbered_",0);
	add_dialog_str(2,"_Give me the package and we will allow you to live. If you resist you will die. If you give it to me we will go our way and leave you for the Watch to find-- everybody goes home happy._",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);

	message_dialog("He thought about it for just a moment before responding. _Tempting-- but I don't think so. Do your worst._","I let out a sigh of relief. If he had handed over the package I'd have ended up at the gallows for sure. If we resisted at least there was a chance we would succeed and be able to teleport away.");
	activate_hidden_group(1);
	activate_hidden_group(3);
	erase_char(7);
	activate_hidden_group(5);
	set_attitude(1001,10);
	set_character_pose(i,2);
	force_instant_Terrain_Redraw();
	set_char_status(i,13,-1 * get_char_status(i,13),1,0);
	if(is_combat() == 0)
		add_char_to_party(18);		
}
if((num_chars_in_group(1) == 0) && (get_flag(18,1) > 0) && (get_flag(18,2) == 0)){
	set_flag(18,2,1);
	reset_dialog();
	add_dialog_str(0,"The last of the blue armored men fell dead. The courier stood among the carnage panting lightly. _Well-- well that's over. You weren't bad._",0);
	add_dialog_str(1,"Perhaps not, my spell casting had improved, but he had been simply masterful. The guards had looked like they were standing still as he danced among them delivering kicks and punches and contorting to avoid their feeble counterattacks.",0);
	add_dialog_choice(0,"I've had some-- troubles-- with the Watch lately, and wouldn't like to stick around. So if you don't mind handing me the package?");
	choice = run_dialog(1);

	reset_dialog();
	add_dialog_str(0,"He handed over the package. _Yeah, sure. I think I'll come along too, I'm not really in the mood to explain all this._ He indicated the dead men strewn about the room.",0);
	add_dialog_str(1,"I'd already ripped the box open and had begun inspecting the teleportation rod. It was pretty standard-- an ivory rod with three sockets in the tip. Two for focusing gems, one for a power supply.",0);
	add_dialog_str(2,"All three had already been fitted with gems. The 'wizards,' as Samael and the others simply referred to them, had already configured it for a destination.",0);
	add_dialog_str(3,"Now if only I knew where that destination was. Presumably it was somewhere safe, but safe for a member of the Azure Banner and safe for me are two different things. It could simply lead to another of there hideouts, and more angry men.",0);
	add_dialog_str(4,"Or-- and this was a particularly grim prospect-- it could lead right here. I pushed the thought away.",0);
	add_dialog_str(5,"_You know how to work this thing or not?_",0);
	add_dialog_choice(0,"I know how. I'm just not sure where it'll take us.....");
	choice = run_dialog(1);

	reset_dialog();
	add_dialog_str(0,"_Well that's a pretty important detail...._ I wasn't paying attention though, I was giving the rod one last look over. It LOOKED like any other rod I'd ever used, but even a subtle difference is a big one in something this delicate.",0);
	add_dialog_str(1,"I didn't have much choice but to trust that the wizards had done their job well, and this thing would carry us to safety. I indicated where to grip the rod, and once he had a firm grasp I prepared to press the button to activate it.",0);
	add_dialog_str(2,"Suddenly it struck me that I didn't even know the man's name.",0);
	add_dialog_choice(0,"I'm Emery by the way. You know, just so I don't die next to a stranger.");
	choice = run_dialog(1);

	reset_dialog();
	add_dialog_str(0,"_It's Theo..... Are you really sure you know how to use this thing? All this talk of dying and unknown destinations-- I'm starting to have second thoughts..._",0);
	add_dialog_choice(0,"No time for second thoughts, just hang on for dear life and hope all goes well.");
	choice = run_dialog(1);

	reset_dialog();
	add_dialog_str(0,"_Oh bloody hell, I'm going to wind up ripped to shreds. Half of me here, half-- god knows where. Oh bloody...._ The magic enveloped us and the sounds of Theo's cursing were growing distant. The room was becoming increasingly faint.",0);
	add_dialog_str(1,"Then it vanished, and we were surrounded only by the void.",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);
	play_sound(10);	
	relocate_character(i,1,1);
	force_view_center(1,1);
	force_instant_terrain_Redraw();
	erase_char(4);
}
break;

beginstate 10;
block_entry(1);
relocate_character(i,24,26);
set_character_pose(i,5);
force_view_center(24,26);
force_instant_terrain_redraw();
reset_dialog();
add_dialog_str(0,"I woke groggily to find myself sitting in a dark room. I attempted to stand but couldn't move. I'd been bound to the chair.",0);
add_dialog_str(1,"A man sat across the table from me. He wore silver armor, but on his breast was the same flag emblem that Jerald and the other blue armored men wore.",0);
add_dialog_str(2,"There was another man standing beside me, and I thought I could see more standing in the shadows at the edge of the room.",0);
add_dialog_str(3,"The man in silver, who was apparently an authority figure, seemed to be lecturing the second man, but the words sounded distant.",0);
add_dialog_choice(0,"OK");
choice = run_dialog(1);
message_dialog("I concentrated and the words came into focus somewhat. _If the rescue had gone successfully, Mauricio, then why is this dog sitting here in place of Durant?_","");
message_dialog("_Samael, sir, I-- I do not know. The rescue-- we tried our best, but without the teleportation rod..... The wizards are to blame, I promise you if we'd had the rod it would have worked. I had it all planned.... But it all hinged on the wizards._","");
message_dialog("_I trusted you, Mauricio. I put you in charge of our most important mission. The mission on which all our plans rested._","_And you failed._ He spoke deliberately but haltingly, like he was trying to hold in his anger. He slowly stood as he talked, and walked around the table to stand face to face with Mauricio.");
message_dialog("_I-- I'm sorry sir. The watch had a wizard with them-- he tore our men to shreds. Jerald was the only other man who made it out of there. I shouted-- I asked whether he was in and he said yes. He told me-- he said we had him._","_It was a mistake....._");
message_dialog("_A..... mistake. Yes-- everybody makes mistakes, Mauricio. We make mistakes and we learn. We fix our mistakes, and we never make the same again._ He grabbed me by the hair and yanked my head back to stare up at him. _Yes-- this is just a mistake._","_So tell me, Mauricio, where is Durant? When will you be fixing your..... 'mistake'?_");
message_dialog("_I-- I do not know sir. I have heard no news. But I'll do whatever I can-- I'll search him out myself sir, I'll go all by myself...._","");
message_dialog("Samael's mailed fist caught Mauricio in the jaw, splattering me with blood and shards of teeth. Mauricio crumpled to writhe about on the floor. _Then look for him in the Void. Or better yet, bring his corpse down from the gibbet before you go._","_Get this cur out of my sight. His punishment will wait-- I have this one to deal with now._ Two men emerged from the shadows to drag Mauricio away.");
erase_char(17);
begin_talk_mode(1);
break;

beginstate 11;
break;

beginstate 12;
if(get_flag(18,1) == 0)
	block_entry(1);
break;

beginstate 20;
message_dialog("_Hmmm.... That's not how the story went...._","");
end_scenario(0);
break;

beginstate 21;
move_to_new_town(19,11,18);
break;


beginstate 100;
block_entry(1);
break;